Dynamic camera mode switching

ABSTRACT

A method for automatic image capture control and digital imaging is described. An image buffer is initialized to store a digital image produced by an image sensor, through allocation of a region in memory for the buffer that is large enough to store a full resolution frame from the image sensor. While non-binning streaming frames, from the sensor and in the buffer, are being displayed in preview, the sensor is reconfigured into binning mode, and then binned streaming frames are processed in the buffer, but without allocating a smaller region in memory for the buffer. Other embodiments are also described and claimed.

RELATED MATTERS

This application claims the benefit of the earlier filing date ofprovisional application no. 61/657,281, filed Jun. 8, 2012.

FIELD

An embodiment of the invention is directed to automatic image capturecontrol in digital imaging and, in particular, switching between binningand non-binning modes while streaming frames from the image sensor.Other embodiments are also described.

BACKGROUND

Binning is a technique used in digital cameras to improve thesensitivity of the camera when the scene is under a low light condition.Binning involves combining at least two pixels into a single pixel thatas a result is more sensitive to light in the scene, where thiscombining is typically performed prior to readout and digitizing of thenew pixel signal. As a result, the photo-generated charge carriers ofthe two or more pixels accumulate, which improves signal to noise ratio,thereby enabling higher quality image recording of scenes that haverelatively low light. A further advantage of binning is higher imagerepetition rate or image recording frequency, also referred to ascapture frame rate, due to a lower spatial resolution. In other words,there are fewer new pixels being read and digitized, which enables theframe rate to increase. Binning, however, does have some disadvantages.There is a reduction in spatial resolution due to the combining ofpixels. In addition, the combination of the pixels may not besymmetrical, so that, for example, unequal numbers of pixels in the xand y direction are combined. This results in distortion and requiresdigital image processing to correct. A further concern arises when theimage sensor is operating in streaming mode and the sequence of framesthat are being output by the sensor are processed and then displayed tothe camera's user by an electronic view finder. This is also referred toas the preview mode of operation. The particular concern here is therisk of dropping too many frames when switching or transitioning betweenbinning mode and non-binning mode. For instance, while a camera may beconfigured to run at a particular frame rate in streaming mode, forexample, 15 frames per second, enough image buffers need to be allocatedin main memory so that the frames do not start overwriting each other orare not “held up” at the sensor. Usually, a direct memory accessfacility is provided for use by the image sensor output interface, torapidly stream its frames directly to the allocated image buffers inmemory. To avoid missing or dropping frames, a larger number of memorybuffers may be allocated. Alternatively, system latency may be reducedsuch that the frames are “removed” from the buffers more quickly. Afurther option is to restrict the amount of image signal processing(ISP) enhancement that is being performed by an ISP pipeline upon theraw frames (that have been written into the image buffers). Finally, theprocessing power of the ISP pipeline buffer may be increased. In mostinstances associated with consumer grade electronic cameras that useCMOS sensors, however, it is typically unavoidable that at least oneframe will be dropped or missed during a transition between binning andnon-binning. This is at least partly due to the image sensor using anelectronic rolling shutter (rather than a global shutter), such that atany given instant in time, there are two successive frames beingcaptured by the sensor. A challenge therefore is to keep the number ofdropped frames as low as possible, thereby contributing to smoothermoving pictures shown to the user during preview.

SUMMARY

A method for automatic image capture control in a digital imaging systemtakes advantage of binning mode to improve sensitivity under low lightconditions, even without the use of a flash. The image sensor isconfigured into a binning mode, such as, for example, 2×2, and theresulting output frames that are produced in streaming mode are thenup-sampled (e.g., by a factor of two in the case of 2×2 binning mode)using an image signal processing (ISP) pipeline backend scaler, torecover the original full frame resolution of the image sensor. Thetransition between non-binning and binning modes may be performeddynamically, i.e. while the sensor continues to operate in streamingmode. The mode change between non-binning and binning may beincorporated into an automatic exposure control process that is at arelatively low layer, relative to, for example, viewfinder, videorecorder, and still recorder processes, making the transition betweenbinning and non-binning transparent to not just the end user but also tohigher layer camera applications.

To help limit the number of frames being missed or dropped during thetransition between modes, the following method for transition betweenmodes may be used. First, an image buffer is initialized to store adigital image produced by the image sensor, where a region in memory isallocated for the image buffer that is large enough to store a fullresolution frame from the sensor. The image sensor is configured tooperate in non-binning streaming mode. Next, non-binned streaming framesfrom the image sensor are then processed by the ISP pipeline, in theimage buffer. Next, while the non-binned frames are being displayed inpreview, the image sensor is reconfigured to operate in binningstreaming mode, such that binned frames are streamed and then processedby the ISP pipeline in the image buffer, but without allocating asmaller region in memory for the image buffer. In other words, eventhough there is a significant reduction in size of each frame in binningmode, for example, by a factor of two or more, the region in memory thathas been allocated for the image buffer is not made smaller but rathermay be kept the same. This allows higher layer camera software(including, for example, a preview module, a video recorder module, or astill picture module) to remain essentially unconcerned with the modetransitions. In a further embodiment, the transition between modes maybe made even more transparent to the higher layer software, by alsoupscaling the binned frames in the image buffer, during preview, priorto the frames being read for writing to the display. In that way, thehigher layer software that will also be operating on the frames thathave been processed by the ISP pipeline can rely on the frames having anessentially fixed resolution, thereby simplifying their own memorymanagement task.

When a decision is made that the image sensor should be transitionedfrom binning mode back to non-binning mode, because the image buffer wasoriginally allocated a sufficiently large region that could store a fullresolution sensor frame, there is no need at that point to reallocate alarger region in memory for the image buffer. This helps reduce theoverall latency in reconfiguring for non-binning mode, which in turnhelps maintain transparency of the dynamic mode switching process tohigher layer camera or image processing applications, while at the sametime helping reduce the number of dropped frames during mode switching.

In another embodiment of the invention, the mode switching process is“motion-aware” in the sense that the mode switching between binning andnon-binning occurs only if detected camera panning is below a threshold.In other words, if a control module detects that the camera is beingpanned by its user (e.g., either being rotated about a vertical orhorizontal axis, for example, or being translated along a plane), thenthe image sensor is not reconfigured between binning and non-binning,but rather remains in its current mode, until the detection indicatesthat the camera panning has dropped to below a certain threshold suchthat the camera is deemed stable. This helps reduce the likelihood thatdropped frames will be visible to the user during preview, particularlywhen there is a lot of motion between the camera and the scene. By asimilar token, when the scene being captured in the streamed frames isdeemed to be static, then a mode transition between binning andnon-binning is allowed to occur at will. This renders the mode switchingvery smooth and hardly noticeable from the standpoint of the user orphotographer, while at the same time, improving the image quality duringpreview (as well as during video recording and still capture).

In another embodiment, after the image sensor has been configured tooperate in binning mode, and binned streaming frames are processed fromthe image sensor that capture a scene, during preview, a shutter releasecommand is received. In that case, a determination has also been madethat a strobe or flash illumination may be needed for either the stillcapture or video recording of the scene. In that case, a pre-flashsequence is performed to determine one or more image capture parametersthat relate to the effectiveness of illumination of the scene during anupcoming main flash sequence. The image sensor is then reconfigured,during the pre-flash sequence, to operate in non-binning mode (based onthe determined image capture parameters). Non-binned frames are thenprocessed during the main flash sequence, leading to either a videorecording containing frames from the main flash sequence, or a stillpicture taken from the main flash sequence. The image capture parametersthat have been determined during the pre-flash sequence may provide anestimate of the distance to an object in the scene. When the objectdistance is found to be short, the image sensor is reconfigured frombinning to non-binning mode, where this follows the understanding thatthe main flash sequence will likely be effective in properlyilluminating the scene and as such binning mode is not necessary. On theother hand, when the object distance is found to be long, then theunderstanding is that the main flash is not likely to be effective inproperly illuminating the object so that a transition from non-binningto binning mode will be beneficial.

The above summary does not include an exhaustive list of all aspects ofthe present invention. It is contemplated that the invention includesall systems and methods that can be practiced from all suitablecombinations of the various aspects summarized above, as well as thosedisclosed in the Detailed Description below and particularly pointed outin the claims filed with the application. Such combinations haveparticular advantages not specifically recited in the above summary.

BRIEF DESCRIPTION OF THE DRAWINGS

The embodiments of the invention are illustrated by way of example andnot by way of limitation in the figures of the accompanying drawings inwhich like references indicate similar elements. It should be noted thatreferences to “an” or “one” embodiment of the invention in thisdisclosure are not necessarily to the same embodiment, and they mean atleast one.

FIG. 1 is a block diagram of a digital camera system.

FIG. 2 is a flow diagram of a process for automatic image capturecontrol digital imaging.

FIG. 3 is a flow diagram of a process for making a decision to switch tobinning mode.

FIG. 4 is a flow diagram of a process for making a decision to switch tonon-binning mode.

FIG. 5 is a flow diagram of a process for automatic image capturecontrol involving a flash sequence.

FIG. 6 shows a portable handheld consumer electronics device being heldin the hand of its user and operating in camera preview.

DETAILED DESCRIPTION

Several embodiments of the invention with reference to the appendeddrawings are now explained. While numerous details are set forth, it isunderstood that some embodiments of the invention may be practicedwithout these details. In other instances, well-known circuits,structures, and techniques have not been shown in detail so as not toobscure the understanding of this description.

FIG. 1 is a block diagram of a digital camera system in which a processfor automatic image capture control, in accordance with an embodiment ofthe invention, may be performed. In one embodiment, the process may beperformed by a processor running an autoexposure control module 6 andfirmware for an image signal processing (ISP) pipeline. The operationsmay be performed by a suitably programmed image signal processor, whichmay be a dedicated microprocessor that is designed for the specializedtasks involved in image processing.

The camera system may be integrated into a consumer electronics devicesuch as a desktop personal computer, a smart phone, a tablet computer,or an office/home entertainment system. The camera system has at leastthe following higher layer camera routines. An electronic viewfindermodule 21 serves to read streaming frames that are output by an ISPpipeline, and display them to a user through a display screen 8. This isalso referred to as preview, where the user can examine an approximationof the scene as it will be captured when she actuates the shutterrelease. As an example, preview can display in essence a “low speed”video of the scene, e.g. at about ten (10) to fifteen (15) frames persecond, so as to reduce power consumption yet still provide the userwith a smooth captured look at the scene while she pans the camera. Avideo recorder module 22 serves to process the output streaming framesfrom the ISP pipeline, into a digital video file, e.g. converts theminto an MPEG format, that is then stored in non-volatile memory. A stillrecorder 23 serves to process one of the output frames from the ISPpipeline into a digital still picture file that is stored innon-volatile memory, e.g. converts the frame into a JPEG file.

In between the autoexposure control 6 and the upper layer camerafunctions of the viewfinder 21, video recorder 22, and still recorder23, may be a camera device driver 19. The camera device driver 19 may bea program that is part of an operating system running in the device inwhich the camera system is integrated, for example, the iOS™ operatingsystem by Apple Inc. The camera device driver is a hardware driverprogram that provides an interface to the upper layer software (such asthe viewfinder, video recorder and still recorder routines), to use thecamera system hardware. For example, the camera device driver 19 mayexpose an application programming interface through which a higher layercamera application can signal a shutter release command, select stillcapture or video recording, and provide manual (user controlled) flashand zoom. The camera device driver 19 may, in some instances, be aprogram that is executed by a different processor than the one used forthe ISP pipeline and the autoexposure control 6, e.g. a system on a chipSoC or an applications processor in the case of a multi-function devicesuch as a smart phone or a tablet computer.

The autoexposure control 6 supplies control signals to several lowerlayer hardware components of the camera, including an image sensor 2(e.g., a CMOS image sensor that provides digitized output frames in astreaming mode), an autofocus lens 5, optics 4 (for through-the-lensimaging), and a strobe or flash 3. The control signals may be forautofocus lens actuator control, zoom lens control, image sensorintegration time, analog and/or digital pixel signal path gain,pre-flash and main flash sequences, and a context switch signal that mayinclude commands to enter binning and no-binning modes while streaming.The image sensor 2 is capable of pixel binning, such as by averaging orby summing the charge carrier signals from two or more pixels. Thiscombining may occur on a per color basis, or it may occur for a group ofpixels that may be deemed a full color combination. The binning optionsmay include binning two pixels together, or four pixels together, orother combinations of pixels, into a single, combo pixel. In bothbinning and non-binning mode, the image sensor 2 outputs a digitized rawimage sequence (streaming frames) at a specified frame rate, where eachframe has the full sensor resolution (non-binned mode) or a reducedresolution (as specified by the particular binning mode). The imagesensor 2 may be able to perform an internal hardware context switch forrapid transitions between its binning and non-binning modes whilestreaming.

The raw image sequence (streaming raw frames) are transferred out by theimage sensor 2, into one or more ISP image buffers 7. An image buffer 7is an allocated storage region in memory that is sufficient to store afull resolution sensor frame. The allocated region in memory may bewithin dynamic random access memory, or static random access memory,which may be of the volatile variety, or it may be within flash memory.The image buffers 7 may be initialized, for example, by the automaticexposure control 6, so that the streaming frames can be written intothem by the sensor 2, e.g. via direct memory access, DMA, where the ISPpipeline then performs its various image processing operations for themost part upon the buffered frames.

The ISP pipeline stages may include at least the following. Instatistics processing 8, the image data (pixels) in one or more framesare analyzed, such as using statistical signal processing techniques, todetermine various parameters used for image capture, namely defectivepixels (and their correction), lens defects, black level compensation,motion history, and scene brightness. The determination of some of theseparameters may be supplemented by input from other sensors or otherprocesses running in the device of which the camera system is a part orto which it is linked, for example, data from a position, orientation ormovement sensor such as an accelerometer or a gyro, a dedicatedproximity sensor, and/or a dedicated ambient light sensor. The result ofsuch statistics processing may be stored (as sensor and scenestatistics) along with the image frames, inside the image buffer 7, oralternatively they may be provided to the autoexposure control 6directly, that is in real-time.

The ISP pipeline may also include a lens distortion correction module 10that makes corrections for defects such as vignetting, blemishes, andlens shading.

Another stage in the ISP pipeline that performs a useful function uponthe frames stored in the image buffer 7 is a noise reduction module 12.In particular, the noise reduction may involve temporal filtering, alsoreferred to as inter-frame filtering, such as averaging two or moreframes based on motion and brightness characteristics, in order toremove imaging noise. The temporal filtering may be adaptive, based onmotion and brightness characteristics. For instance, when object motionis high the filter strength may be reduced in order to avoid theappearance of “trailing” or “ghosting” artifacts in the resultingprocessed image. On the other hand, the filtering strength may beincreased when there is little or no motion being detected.Additionally, the filtering strength may be adjusted based uponbrightness data or luma data. For example, as scene brightnessincreases, filter artifacts may become more noticeable to the human eye.In that case, the filtering strength may be reduced when the pixelsindicate a high level of brightness.

Next in the ISP pipeline, as shown in FIG. 1, is a binning compensationfilter (BCF) 13. The BCF is only turned on or used when the raw imagesequence streaming from the image sensor 2 are binned frames (as opposedto non-binned frames). The BCF may process pixels of a given frame tocompensate for non-linear placement of the binned color samples, so thatsubsequent image processing operations in the pipeline, for instancedemosaicing, that depend on linear placement of the color samples, canoperate correctly.

Next in the sequence may be an automatic white balance (WB) module 15which may perform further adjustments on the pixels of each frame, forexample, using a color correction matrix.

At some point in the ISP pipeline, a demosaicing module 16 is needed,assuming, of course, the image sensor 2 has, for example, a color filterarray (e.g., a Bayer pattern) that produces individual color componentpixels (that are assigned to separate color components, respectively)rather than providing full color pixels.

Towards the end of the ISP pipeline, although not necessarily in thelast stage, is a backend upscaler 17, which serves to upscale orup-sample each binned frame that is to be output by the ISP pipeline, soas to recover the full frame resolution of the image sensor 2. As withthe BCF 13, the upscaler 17 is turned off or skipped when the imagesensor 2 is operating in non-binning mode.

As explained above, the initialization of an image buffer 7, by, forexample, the autoexposure control 6, for storing a frame produced by theimage sensor 2, is performed by allocating a region in memory that islarge enough to store a full resolution frame from the image senor 2.This buffer size may be kept unchanged during both binning andnon-binning modes. Once the buffered streaming frames have beenprocessed by the ISP pipeline, including the backend upscaler 17 in thecase of binning mode, the frames are then prepared for display inpreview, by the electronic viewfinder 21. The autoexposure control 6 isalso responsible for making the decision as to whether or not the imagesensor 2 should be reconfigured into binning or non-binning mode, bysignaling its decision through a context switch command that is given tothe image sensor 2.

A process for automatic image capture control using, for instance, thedigital imaging system of FIG. 1 (or any other suitable digital imagingsystem that has the needed functionality) is depicted in FIG. 2. In thiscase, the camera system may be integrated within a multi-function devicesuch as a laptop computer, a smart phone, a desktop computer or a tabletcomputer, or other consumer electronics device, including a device thatmay be integrated in a vehicle. The process begins with a cameraapplication being launched (block 30). In some cases, the cameraapplication may be operating as a background task and as such does notrequire its shutter release commands to be manually input by the user.In other instances, the camera system is part of a dedicated,professional digital camera. Next, operation proceeds with block 31 inwhich one or more ISP image buffers are allocated (e.g., for the firsttime), where each buffer can store the image data of a frame that is atfull image sensor frame resolution. In some cases, when the streamingmode of operation for the image sensor is running at a relatively highframe rate, several image buffers may need to be allocated to form aqueue. The actual allocation of regions in memory may be performed, forexample, by autoexposure control firmware (part of the autoexposurecontrol module 6—see FIG. 1).

The process continues with configuring the ISP pipeline and the imagesensor 2 for a non-binning streaming mode of operation (block 33). Thus,referring to FIG. 1, in the ISP pipeline, certain stages may be disabledincluding the BCF 13 and the upscaler 17, for no-binning mode. Operationthen continues with preview, where the electronic viewfinder 21 is firstlaunched (or otherwise continues running) to pull frames from thebackend of the ISP pipeline and prepares and submits them to the display8 according to a set frame rate, e.g. slow video at about 10-15 framesper second.

At some point during preview, the conditions in the scene being capturedmay be such that it would be desirable to switch to binning mode. Thedecision in block 36 may be made to switch to binning mode, when thebrightness or scene lighting level has dropped to below a threshold.Other criteria may be used in addition or as an alternative, to findthat it is time to switch to binning mode. At that point, operationcontinues with blocks 37-40, where the image sensor 2 is signaled tocontext switch into binning streaming mode, and the ISP pipeline isreconfigured for processing binned frames (e.g., by enabling one or morestages such as the binning compensation filter and the backend upscaler,and by recognizing the smaller image data set being written into theimage buffers 7 from the sensor 2). In addition, the preview continues(block 41) in binning mode, without reallocating the ISP image buffers 7into a smaller size (block 40).

In some instances, the ISP image buffers 7 that are used to receive thestreaming frames being output from the image sensor 2 remain essentiallyunchanged in size, so that no additional reallocation of a significantamount of storage within the memory is needed. This is in contrast to amore conventional technique where the ISP image buffers 7 are at thispoint reallocated into a smaller size, because the binned frames will beof substantially smaller resolution (e.g., smaller by a factor of 2 ormore).

The preview may continue (in block 41) with the same size ISP imagebuffers 7, until a decision is made to switch back to no-binning mode(block 42). For example, if the scene lighting resumes a bright level,then processing should be changed to no-binning mode, for example, toavoid saturating the pixels that are being binned. Upon such a decisionbeing made, the process continues with blocks 43-46 where the imagesensor is signaled to context switch back to no-binning mode, the ISPpipeline is reconfigured for no-binning mode processing (e.g., bydisabling the binning compensation filter and the upscaler, and byrecognizing the larger image data set being written into the imagebuffer 7 from the image sensor 2), but there is no need to reallocatethe ISP image buffers 7 into a larger size.

Thus, the image buffers 7 may remain the same size throughout preview,and in particular at a size that is sufficient for storing fullresolution sensor frames, during transitions between binning andnon-binning modes. This process makes it easier for higher levelsoftware such as the viewfinder 21, video recorder 22 or still recorder23, to manage the transitions between binning and non-binning, by ineffect making those transitions transparent to the higher layersoftware. In addition, there being no need to reallocate storage regionsin memory during mode transitions, the number of dropped frames may bereduced, as the ISP pipeline is able to quickly transition itsprocessing, between the two modes. As to the higher level software, thismay be designed to accept a single size or resolution for the streamingframes, regardless of whether binning or non-binning mode is takingplace. That is because the backend upscaler 17 ensures that, duringbinning mode, the streaming frames being made available by the ISPpipeline to higher layer software have already been upscaled into thefull resolution frame size.

Turning now to FIG. 3, this is a flow diagram of a process that may beused in block 36 of FIG. 2, for making the decision to switch to binningmode. The process in block 36 is arrived at while continuing preview, inthe no-binning streaming mode. During such preview, scene brightness isdetected (block 51) and user panning of the camera is also detected(block 53). This monitoring of the scene brightness, and the level atwhich the user is panning the camera, can be performed by theautoexposure control module 6 (see FIG. 1) using, for example, sensorand scene statistics that have been provided by the frontend of the ISPpipeline for each frame. To determine whether or not a user is panningthe camera, any one of several conventional techniques may be used,including one that is based solely on, for example, tracking an objectin the streaming frames using digital image processing, to detect thechanges between an object and the background as the streaming framescontinue to be processed during preview. As an alternative or inaddition, external sensors may be used such as ambient light sensors,proximity sensors, position orientation or movement sensors, to detectthe scene brightness and whether the user is panning the camera orsimply holding the camera relatively still in one spot. The processcontinues with block 54 where if the scene has gone dim or thebrightness has dropped below a predetermined threshold, then a furthertest is performed before deciding that there should be a switch tobinning mode. In particular, block 56 requires the process to determinewhether the user is panning the camera, or in other words whether camerapanning remains below a given threshold. If the camera panning remainsbelow a threshold, that is the user is not panning the camera, thenblock 57 is reached where the appropriate control signals are assertedto switch to binning mode. On the other hand, even if the scene has gonedim, if the user happens to be panning the camera or the camera panningremains above a threshold, then the ISP pipeline and image sensor shouldnot be switched to binning mode (block 55). This process helps ensurethat the benefits of switching to binning are not outweighed by itsweaknesses, such as dropped frames, particularly when the camera isbeing panned. That is because the inevitable dropping of frames duringthe switch to binning mode is likely to be much more apparent to theuser (in preview) when the camera is being panned. Once the camera hasstabilized, however, then the decision in block 56 allows a switch tobinning mode (provided, of course, that the scene is still dim), whichwould result in a benefit of improved image quality even without aflash.

The motion aware decision making for transitioning between binning andnon-binning mode has a counterpart process that is depicted in FIG. 4.This process is an example of block 42 in FIG. 2, which is the decisionto switch from binning to no-binning mode. Once again, the processbegins with continuing in preview, but this time while binning. Scenebrightness is detected (block 61), as well as user panning of the camera(block 63), which may be in a similar manner as described above inconnection with FIG. 3. If the monitored or detected data reveals thatthe scene brightness has risen above a threshold (block 64) and thatcamera panning is below a threshold such that the user is deemed to nolonger be panning (block 66), then the image sensor should bereconfigured to operate in no-binning streaming mode (block 67).

When the above processes of FIG. 3 and FIG. 4 are implemented togetherduring a streaming frame sequence in preview, it can be seen that theimage sensor is reconfigured between binning streaming mode andno-binning streaming mode only if detected camera panning is below athreshold. In addition, the image sensor is not reconfigured (betweenbinning and no-binning) when detected camera panning is above athreshold.

Turning now to FIG. 5, this is a flow diagram of a process for automaticimage capture control involving a strobe or flash. The image capturecontrol process here involves a pre-flash sequence followed by a mainflash sequence. In the pre-flash sequence, the automatic exposurecontrol module 6 (see FIG. 1) determines one or more image captureparameters that relate to the effectiveness of illumination of the sceneduring an upcoming main flash sequence. These image capture parametersmay include one or more of the following: pre-flash frames statistics,integration time, analog and digital pixel signal path gain values,estimates of the distance between the camera to an object in the scene,strobe or main flash intensity, and scene brightness level. Of course,the actual effect of the main flash on the scene may not be observed ordetected by image capture circuitry until it occurs. As such, theelectronic device may estimate the effect of the main flash on the sceneusing the above-identified parameters and/or other streaming framestatistics or sensor statistics, during the pre-flash sequence. Thepre-flash sequence may include a time interval during which a source ofillumination, such as the same lamp that will be used to provide theillumination during the main flash sequence, is used to illuminate thescene, albeit typically at a lower intensity than the main flash, whilea few frames are processed by the ISP pipeline and analyzed. Theexposure control module 6 may then extrapolate certain main flash imagecapture statistics that are expected to occur during the main flashsequence, where these extrapolated statistics are then used to determinethe image capture control parameters to be applied during the main flashsequence. Thus, for instance, one or more of the parameters computedduring the pre-flash sequence may be adjusted (e.g., integration time,analog or digital pixel signal path gain, and flash lamp intensity) tobe applied in the main flash sequence.

With the above in mind, referring back to the flow diagram of FIG. 5,operation begins with configuring the image sensor to operate in binningstreaming mode, or alternatively beginning with non-binning streamingmode (block 71). At this point, the streaming frames may also beprocessed according to preview (by the electronic viewfinder 21). Sometime during preview, a command is given (e.g., manually by the user) tobegin the recording of a video session, which invokes the video recorder22, or to take a still picture which invokes the still recorder 23 (seeFIG. 1). This may be a shutter release command that is given to thecamera device driver 19, which in turn provides the command to theautoexposure control 6. Operation then continues with block 73, wherebinned streaming frames from the image sensor are processed that capturea scene. Note that block 73 also refers to the other scenario wherenon-binned streaming frames are being processed (where the image sensorhas been configured into no-binning streaming mode).

Next, a pre-flash sequence is performed (block 74) by the automaticexposure control module 6, to determine one or more image captureparameters or image capture statistics, relating to the effectiveness ofillumination of the scene during the upcoming main flash sequence. Alsoduring the pre-flash sequence, a decision is made as to whether toreconfigure the image sensor (and the ISP pipeline—see FIG. 1) to switchbetween non-binning and binning streaming modes, based on the determinedimage capture parameters or scene statistics (block 76). For instance,if the estimated distance to an object in the scene is short, then itmay be expected that the main flash will be effective in properlyilluminating the object, and as such the image sensor (and the ISPpipeline) should either remain in no-binning mode or be transitionedinto it. On the other hand, if during the pre-flash sequence, theestimated object distance is long, then it may be expected that the mainflash will not be effective in properly illuminating the object, suchthat the image sensor (and the ISP pipeline) should either remain inbinning mode or be transitioned into it.

After reconfiguring the image sensor to operate in non-binning streamingmode (or, alternatively, binning streaming mode, as the case may be)during the pre-flash sequence, non-binned streaming frames (or,alternatively, binned streaming frames) are processed during the mainflash sequence (in block 78). Here, at least some of those non-binnedstreaming frames (or, alternatively, binned streaming frames) werecaptured by the image sensor while the scene was under illumination bythe main flash.

FIG. 6 shows a portable handheld consumer electronics device being, inthis case, a smart phone in which a digital camera system, in accordancewith an embodiment of the invention can be integrated. The device mayalternatively be any one of several different types of portable consumerelectronic devices that can be easily held in the user's hands duringnormal use, such as a tablet computer. The device has an externalhousing in which are integrated several components that include a cameramodule, a touchscreen, and a menu button. The touchscreen (whichincludes the display screen 8—see FIG. 1) has a display area in whichthe streaming frames from the image sensor that capture a scene or anobject (here a flying insect) are being displayed during preview. Thetouchscreen is viewable by the user or photographer who is using thecamera system to not just examine the recorded still and/or pictures butalso to enter manual commands. The touchscreen in this example includesa shutter release virtual button, a picture album virtual button, and azoom virtual slider. Of course, as an alternative to a touchscreen, someor all of the virtual buttons may be instead implemented using physicalbuttons.

The camera module may contain the through-the-lens imaging optics 4 (seeFIG. 1), the image sensor 2, and the autofocus lens 5 all integratedwithin the same module assembly. The flash 3 may or may not beintegrated with the module. As suggested above, the raw image sequenceprovided by the image sensor 2 in binning or non-binning streaming modewill be transferred to the ISP image buffers 7 using conventional imagesensor interfaces. An electrical bus, for example, using a flexconnector or other printed circuit board connector, may be used todeliver the streaming raw image sequence to memory integrated circuits.In addition, other electrical buses may connect the memory to an ISPprocessor that has been programmed to perform the ISP pipeline stagesand the autoexposure control processes described above in connectionwith FIG. 1. A separate applications processor or system on a chip (SoC)may also be provided within the housing of the portable device. Theapplications processor or SoC may be programmed with an operating systemthat may include the camera device driver 19. There may also be higherlayer programs running on the SoC or the applications processor, such asa digital camera application program, which may have modules whosefunctions are similar to those of the viewfinder 21, video recorder 22,and still recorder 23. All of the above may be integrated within thehousing of the portable device as it is depicted in FIG. 6. As analternative, some parts of the camera system, such as the camera module,may be in a separate housing that is connected by a wireless or wiredcommunications link to the SoC or applications processor that is in thehousing of a “host” device.

The various embodiments of the invention described above in connectionwith FIGS. 1-5 concerning the transition between binning and non-binningmodes are particularly desirable when the camera system is integrated aspart of a complex, portable multi-function device such as a smart phone,or a tablet computer, where these are consumer electronics devices thatare battery powered and therefore have limited processing and storagecapabilities despite recent advances in those technology areas. It isdifficult to ensure smooth and rapid transitions between binning andnon-binning modes in such portable consumer electronics devices,particularly when the devices are being used in camera preview asdepicted in FIG. 6.

As explained above, an embodiment of the invention may be amachine-readable medium or storage circuitry (such as microelectronicmemory) having stored thereon instructions, which program one or moredata processing components (generically referred to here as a “machine”or a “processor” or “data processing circuitry”) to perform the modetransition decision making operations and the digital image processingoperations described above, in connection with the autoexposure controlmodule 6 and the ISP pipeline. In other embodiments, some of theseoperations might be performed by specific hardware components thatcontain hardwired logic (e.g., dedicated digital filter blocks and statemachines). Those operations might alternatively be performed by anycombination of programmed data processing components and fixed hardwiredcircuit components.

In accordance with an embodiment of the invention, a method forautomatic image capture control in digital imaging, comprises:configuring an image sensor to operate in non-binning streaming mode;processing non-binned streaming frames from the image sensor; while thenon-binned streaming frames are being displayed in preview, detectingscene brightness and camera panning; and reconfiguring the image sensorto operate in binning streaming mode, and then processing binnedstreaming frames from the image sensor, in response to having detectedthat the scene brightness has dropped below a threshold and camerapanning remains below a threshold.

In another embodiment, an article of manufacture comprises amachine-readable storage medium having stored therein instructions thatprogram a machine to configure an image sensor to operate in binningstreaming mode, and process binned streaming frames from the imagesensor, and wherein while the binned streaming frames are beingprocessed for display in preview mode, the programmed machine is toreconfigure the image sensor to operate in no-binning streaming mode andthen process non-binned streaming frames from the image sensor, andwherein the machine is programmed to reconfigure the image sensorbetween binning streaming mode and no-binning streaming mode, only ifdetected camera panning is below a threshold, and to not reconfigure theimage sensor between binning streaming mode and no-binning streamingmode when detected camera panning is above a threshold.

While certain embodiments have been described and shown in theaccompanying drawings, it is to be understood that such embodiments aremerely illustrative of and not restrictive on the broad invention, andthat the invention is not limited to the specific constructions andarrangements shown and described, since various other modifications mayoccur to those of ordinary skill in the art. For instance, in FIG. 1,the various stages of the ISP pipeline are shown in a particular order.However, it should be recognized that some of these stages may beperformed in a different order or sequence, particularly those whoseimage processing functions are linear in nature. Also, although theabove-described techniques for performing binning/non-binning modetransitions can be applied in a wide range of digital camera systems,their application is particularly effective in portable personalconsumer electronics devices such as smart phones and tablet computerswhere a relatively large display area is provided for use by anelectronic viewfinder to perform preview. An aim in that particularscenario is to provide a smooth transition between binning andnon-binning modes, so that the transitions may appear essentiallytransparent to the user, by virtue of having a fewer or limited numberof missed or dropped frames. The above description is nevertheless to beregarded as illustrative instead of limiting.

What is claimed is:
 1. A method for automatic image capture control indigital imaging, comprising: initializing an image buffer to store adigital image produced by an image sensor, by allocating a region inmemory for the image buffer that is large enough to store a fullresolution frame from the image sensor; configuring the image sensor tooperate in non-binning streaming mode; processing non-binned streamingframes from the image sensor, in the image buffer; and while thenon-binned streaming frames are being displayed in preview,reconfiguring the image sensor to operate in binning streaming mode andthen processing binned streaming frames from the image sensor, in theimage buffer, without allocating a smaller region in memory for theimage buffer.
 2. The method of claim 1 wherein processing binnedstreaming frames comprises: up scaling the binned streaming frames inthe image buffer during preview and prior to the frames being read forwriting to a display.
 3. The method of claim 2 wherein processing binnedstreaming frames comprises: temporal filtering for noise reduction andbinning compensation filtering both prior to up scaling the frames. 4.The method of claim 2 further comprising: processing one of the upscaled frames in the image buffer into a digital still picture file thatis stored in non-volatile memory.
 5. The method of claim 2 furthercomprising: processing a series of up-scaled frames taken from the imagebuffer into a digital video file that is stored in non-volatile memory.6. The method of any one of claims 1 further comprising: detecting scenebrightness and camera panning during the preview, wherein saidreconfiguring the image sensor to operate in binning streaming mode isin response to having detected that the scene brightness has droppedbelow a threshold and camera panning remains below a threshold.
 7. Anarticle of manufacture comprising: a machine-readable storage mediumhaving stored therein instructions that program a machine to allocate aregion in memory for an image buffer that is large enough to store afull resolution frame from an image sensor, configure the image sensorto operate in binning streaming mode, and process binned streamingframes from the image sensor, in the image buffer, and wherein while thebinned streaming frames are being processed for display in preview, theprogrammed machine is to reconfigure the image sensor to operate inno-binning streaming mode and then process non-binned streaming framesfrom the image sensor, in the image buffer, without allocating a largerregion in memory for the image buffer.
 8. The article of manufacture ofclaim 7 wherein the stored instructions are such that the programmedmachine processes binned streaming frames by up scaling the binnedstreaming frames in the image buffer, during preview and prior to theframes being read for writing to a display.
 9. The article ofmanufacture of claim 8 wherein the stored instructions are such that theprogrammed machine processes binned streaming frames by temporalfiltering for noise reduction and applying binning compensationfiltering, both prior to up scaling the frames.
 10. The article ofmanufacture of any one of claims 7 wherein the stored instructionsprogram the machine to detect scene brightness and camera panning duringthe preview, and wherein the re-configuration of the image sensor tooperate in no-binning streaming mode is in response to having detectedthat the scene brightness has risen above a threshold and that camerapanning is below a threshold.
 11. The article of manufacture of any oneof claims 7 wherein the stored instructions program the machine toreconfigure the image sensor between binning streaming mode andno-binning streaming mode, only if detected camera panning is below athreshold, and to not reconfigure the image sensor between binning modeand no-binning mode when detected camera panning is above a threshold.12. A method for automatic image capture control in digital imaging,comprising: configuring an image sensor to operate inbinning/non-binning streaming mode; processing binned/non-binnedstreaming frames from the image sensor that capture a scene; performinga pre-flash sequence to determine one or more image capture parametersrelating to effectiveness of illumination of the scene during anupcoming main flash sequence; during the pre-flash sequence,reconfiguring the image sensor to operate in non-binning/binningstreaming mode based on the determined image capture parameter; andprocessing non-binned/binned streaming frames from the image sensorduring the main flash sequence.
 13. The method of claim 12 wherein theone or more image capture parameters comprise an estimate of distance toan object in the scene, and wherein the image sensor is reconfiguredfrom binning streaming mode to no-binning streaming mode when the objectdistance is short and a main flash is likely to be effective, and fromno-binning streaming mode to binning streaming mode when the objectdistance is long and a main flash is not likely to be effective.
 14. Adigital camera system comprising: an image sensor that can outputstreaming frames in binning mode and non-binning mode; a display screen;storage containing an image buffer that is being large enough to store afull resolution sensor frame; storage containing a camera viewfindermodule, an auto exposure control module, and an image signal processing(ISP) pipeline module; and data processing circuitry to execute theviewfinder, auto exposure control module and ISP pipeline modules, toread streaming frames from the image buffer that have been processed bythe ISP pipeline module and process them for display on the displayscreen, and to signal the image sensor to transition from non-binningmode to binning mode but without reallocating the image buffer into asmaller size.
 15. The system of claim 14 wherein the ISP pipeline modulecomprises an upscaler that is to upscale binned streaming frames in theimage buffer during preview and prior to the frames being read fordisplay.
 16. The system of claim 15 wherein the ISP pipeline module isto perform temporal filtering for noise reduction and binningcompensation filtering, prior to upscaling the frames.
 17. The system ofclaim 14 wherein the data processing circuitry is to reconfigure theimage sensor to operate in no-binning streaming mode in response tohaving detected, during preview, that scene brightness has risen above athreshold and that camera panning is below a threshold.